<!--
Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->

<link rel="import" href="topeka-quiz-fill-blank.html">

<polymer-element name="topeka-quiz-fill-two-blanks" extends="topeka-quiz-fill-blank">
<template>

  <style>
  
    paper-input {
      width: 100%;
      height: 48px;
    }
    
  </style>
  
  <shadow></shadow>
  <paper-input inputValue="{{value2}}" label="Fill in the Blank"></paper-input>

</template>
<script>

  Polymer('topeka-quiz-fill-two-blanks', {
    
    reset: function() {
      this.super();
      this.value2 = null;
    },
    
    isCorrect: function() {
      var a = this.quiz.answer;
      var v = [this.value, this.value2].sort();
      if (a && a.length === 2) {
        return this.areEqual(v[0], a[0]) && this.areEqual(v[1], a[1]);
      }
    }
    
  });

</script>
</polymer-element>